' ASdesk TextImager Algorithm ' ' by: Michael A. Smith ' '******************************' ' ' ' ~Algoritm Functions~ ' 'This algorithm will allow you ' 'to transform text to an image ' ' ' '******************************' 'if you use this code, ' please credit Michael Smith; ' 'Easy to use code in future programs ' 'The actual work only consists of 12 lines and 3 functions ' 'Possible Uses ' Conversion of Text (via a liberty basic program to bmp image) ' Security Purposes (via online(Letter Authentication)) ' 'Future Features 'Create own Server for Source$ 'Use text editor for text entry [variable.load] Source$="http://www.ewbi.com/ewbi.develop/text/text.ashx?text=" 'You may want to look at http://ewbi.blogs.com/develops/2005/11/aspnet_dynamic_.html 'This algoritm relies on the previous variables [start.program] 'Start the Program print "' ASdesk TextImager Algorithm '" print "' by: Michael A. Smith '" print "'******************************'" print "' '" print "' (YOU MUST BE ON INTERNET) '" print "" input "Text to convert> ";TextToConvert$ 'Collect the text that the user wishes to convert (A Text Editor is next) 'prompt "Text to convert> ";TextToConvert$ cls print " Starting Algoritm..." print "" [run.algorithm] 'Collect Text (goto page server invisibly), download source. Save Source to file. Wala, youre done ' ' ' Some functions were taken from ' (http://www.alycesrestaurant.com/urlmon.htm) 'Download html from given 'URL to file on disk. ' 'Minimum availability Internet Explorer 3.0 'Minimum operating systems Windows NT 4.0, Windows 95 ' 'check for valid URL for HTML page: print "Getting information from page server..." SourceFrom$=Source$;TextToConvert$ u$ = MultiByteToWideChar$(SourceFrom$) if u$ = "" then print "Unable to convert URL to unicode string." end end if 'now attempt to download the banner: print "Saving your image..." 'will have buttons that say SAVE and CANCEL: filedialog "Save As...", "*.bmp", SaveImageAs2$ SaveImageAs$=SaveImageAs2$;".bmp" result = DownloadToFile(SourceFrom$, SaveImageAs$) if result <> 0 then cls print "Error downloading ";SourceFrom$ else [done] print "Running MSPAINT with Text inside" run "mspaint.exe " + chr$(34) + SaveImageAs$ + chr$(34) cls print "Done!" end if end wait Function DownloadToFile(urlfile$, localfile$) open "URLmon" for dll as #url calldll #url, "URLDownloadToFileA",_ 0 as long,_ 'null urlfile$ as ptr,_ 'url to download localfile$ as ptr,_ 'save file name 0 as long,_ 'reserved, must be 0 0 as long,_ 'callback address, can be 0 DownloadToFile as ulong '0=success close #url end function Function ValidURL(urlfile$) open "URLmon" for dll as #url calldll #url, "IsValidURL",_ 0 as long,_ 'ignored, must be 0 urlfile$ as ptr,_ 'urlfile to check 0 as ulong,_ 'ignored, must be 0 ValidURL as long close #url end function function MultiByteToWideChar$(String$) 'converts any string into unicode CodePage = 0 : dwFlags = 0 cchMultiByte = -1 lpMultiByteStr$ = String$ cchWideChar = len(String$) * 3 lpWideCharStr$ = space$(cchWideChar) calldll #kernel32, "MultiByteToWideChar", _ CodePage as ulong, _ 'CP_ACP=0, ansi code page dwFlags as ulong, _ 'use 0, flags for character translation lpMultiByteStr$ as ptr,_'the ascii string to convert cchMultiByte as long, _ 'len of string, -1 for null-terminated string lpWideCharStr$ as ptr, _'buffer for returned ansi string cchWideChar as long, _ 'size in wide characters of string buffer result as long 'returns number of wide characters written to buffer if result = 0 then MultiByteToWideChar$ = "" else MultiByteToWideChar$ = left$(lpWideCharStr$, result * 2) end if end function